package com.xiaoxi.observermode;

import com.xiaoxi.observermode.generator.IncrementalNumberGenerator;
import com.xiaoxi.observermode.generator.RandomNumberGenerator;
import com.xiaoxi.observermode.observer.DigitObserver;
import com.xiaoxi.observermode.observer.FrameObserver;
import com.xiaoxi.observermode.observer.GraphObserver;
import com.xiaoxi.observermode.observer.Observer;

/**
 * @Author xiaoxi
 * @ProjectName design_mode
 * @PackageName com.xiaoxi.observermode
 * @ClassName Main
 * @Description TODO
 * @Date 2023/3/27 15:42
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {
        Observer observer1 = new GraphObserver('*');
        Observer observer2 = new DigitObserver();
        Observer observer3 = new GraphObserver('-');

//        RandomNumberGenerator randomNumberGenerator = new RandomNumberGenerator();
//        randomNumberGenerator.addObserver(observer1);
//        randomNumberGenerator.addObserver(observer2);
//        randomNumberGenerator.addObserver(observer3);
//        randomNumberGenerator.execute();
//
//        IncrementalNumberGenerator incrementalNumberGenerator = new IncrementalNumberGenerator(10, 50, 5);
//        incrementalNumberGenerator.addObserver(observer1);
//        incrementalNumberGenerator.addObserver(observer2);
//        incrementalNumberGenerator.addObserver(observer3);
//        incrementalNumberGenerator.execute();


        RandomNumberGenerator numberGenerator = new RandomNumberGenerator();
        Observer frameObserver = new FrameObserver("测试");
        numberGenerator.addObserver(frameObserver);
        numberGenerator.execute();


    }
}
